<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>{% block title %}{% endblock %}</title>
  <link rel="stylesheet" href="/static/CloudCss/layui.css">
  <link rel="stylesheet" href="/static/CloudCss/media.css">
  <link rel="stylesheet" href="/static/CloudCss/Cloud.css">
  <link rel="stylesheet" href="/static/CloudCss/waitMe.css">
  <style>
    .layui-nav-tree .layui-nav-item>a {
      padding-top: 0;
    }
  </style>
  {% block css %}{% endblock %}
</head>

<body>
  <div class="layui-layout layui-layout-admin">
    <div class="layui-header">
      <div class="layui-logo layui-hide-xs layui-bg-black">Yy云商后台管理</div>
      <!-- 头部区域（可配合layui 已有的水平导航） -->
      <ul class="layui-nav layui-layout-left">
        <!-- 移动端显示 -->
        <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
          <i class="layui-icon layui-icon-spread-left"></i>
        </li>
        <!-- <li class="layui-nav-item layui-hide-xs"><a href="javascript:;">nav 1</a></li>
        <li class="layui-nav-item layui-hide-xs"><a href="javascript:;">nav 2</a></li>
        <li class="layui-nav-item layui-hide-xs"><a href="javascript:;">nav 3</a></li>
        <li class="layui-nav-item">
          <a href="javascript:;">nav groups</a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:;">menu 11</a></dd>
            <dd><a href="javascript:;">menu 22</a></dd>
            <dd><a href="javascript:;">menu 33</a></dd>
          </dl>
        </li> -->
      </ul>
      <ul class="layui-nav layui-layout-right">
        <li class="layui-nav-item layui-hide layui-show-sm-inline-block">
          <a href="javascript:;">
            <img src="/static/CloudImages/云商/临时图片/layui图标.png" class="layui-nav-img">
            <span id="YyName"></span>
          </a>
          <dl class="layui-nav-child">
            <dd><a href="/web/CloudShop/index/">前往首页</a></dd>
            <dd><a href="javascript:;" lay-on="edit_login">退出账号</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
          <a href="javascript:;">
            <i class="layui-icon layui-icon-more-vertical"></i>
          </a>
        </li>
      </ul>
    </div>
    <div class="layui-side layui-bg-black">
      <div class="layui-side-scroll">
        <!-- 左侧导航区域 layui-nav-itemed -->
        <ul class="layui-nav layui-nav-tree" lay-filter="test">


          <li class="layui-nav-item {% if request.path == '/web/CloudShop/admin/index/' %} layui-this {% endif %}"><a
              href="/web/CloudShop/admin/index/">首页</a></li>

          <li class="layui-nav-item {% if '/admin/goods/' in request.path %} layui-nav-itemed {% endif %}">
            <a class="" href="javascript:;">商品</a>
            <dl class="layui-nav-child ">
              <dd class="{% if request.path == '/web/CloudShop/admin/goods/update_goods/' %} layui-this {% endif %}">
                <a href="/web/CloudShop/admin/goods/update_goods/">上传商品</a>
              </dd>
              <dd class="{% if request.path == '/web/CloudShop/admin/goods/show_order/' %} layui-this {% endif %}">
                <a href="/web/CloudShop/admin/goods/show_order/">我的订单</a>
              </dd>
            </dl>
          </li>
        </ul>
      </div>
    </div>
    <div class="layui-body">
      <!-- 内容主体区域 -->
      <div style="padding: 15px;">
        <div class="layui-card layui-panel" id="YyMain">
          {% block body %}{% endblock %}
        </div>
        <br><br>
      </div>
    </div>

  </div>


</body>
<script src="/static/CloudJs/jquery-3.4.1.min.js"></script>
<script src="/static/CloudJs/layui.js"></script>
<script src="/static/CloudJs/axios.js"></script>
<script>

  // 配置axios
  // 添加请求拦截器
  axios.interceptors.request.use(function (config) {
    // 在发送请求之前做些什么
    $('#YyMain').waitMe({
      effect: 'bounce',
      text: '正在处理...'
    })
    return config;
  }, function (error) {
    // 对请求错误做些什么
    return Promise.reject(error);
  });

  // 添加响应拦截器
  axios.interceptors.response.use(function (response) {
    // 2xx 范围内的状态码都会触发该函数。
    // 对响应数据做点什么
    // 关闭loading
    $('#YyMain').waitMe("hide");
    layui.use(function () {
      var layer = layui.layer;
      layer.msg(response.data.msg, { icon: 1 })
    })
    return response;
  }, function (error) {
    // 超出 2xx 范围的状态码都会触发该函数。
    // 对响应错误做点什么

    // 关闭loading
    layui.use(function () {
      var layer = layui.layer;
      layer.msg(error.response.data.msg, { icon: 2 })
    })
    $('#YyMain').waitMe("hide");
    return Promise.reject(error);
  });
</script>
<!-- loading 插件 -->
<script src="/static/CloudJs/waitMe.js"></script>
<!-- 阿里巴巴图标 -->
<script src="https://at.alicdn.com/t/c/font_4603422_isjt3a1s19r.js"></script>
<!-- 自定义JS -->
<script src="/static/CloudJs/CloudJS.js"></script>

<!-- 全局JS -->
<script>
  if (YyGetLocatStorge() == null) {
    window.location.href = '/web/CloudShop/login_register/';
  }

  layui.use(function () {
    var util = layui.util;
    util.on('lay-on', {
      edit_login: function () {
        YyRemoveItem(user_key);
        YyRefresh();
      }
    });


  });
  const Yyuser_info = YyGetLocatStorge();
  $('#YyName').html(Yyuser_info.user_name);
</script>

{% block js %}{% endblock %}

</html>